<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 08-构造函数当普通函数设置
      function Dog(name, age, color) {
        this.name = name;
        this.age = age;
        this.color = color;
        this.eat = function () {
          console.log("吃肉");
        };
      }
      var d1 = new Dog("小黑", 2, "black");
    </script>
  </body>
</html>
